package historymanager.model;

import java.util.Vector;

/**
 * Is used to create a data-object for serialization
 * 
 * @author Thomas Aulich
 * @version 1.0
 *
 */
public class MeasureTimeSeries {

	private long id;
	private String label;
	private String unit;
	private Vector<Object> data;
	private MeasurePoint measurePoint;
	private int size = 0;

	public void setMeasurePoint(MeasurePoint measurePoint) {
		this.measurePoint = measurePoint;
		id = measurePoint.getId();
		label = measurePoint.getAliasName();
		unit = measurePoint.getUnit();
		data = new Vector<Object>();
	}

	public MeasurePoint getMeasurePoint() {
		return measurePoint;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Vector<Object> getData() {
		return data;
	}

	public void setData(Vector<Object> data) {
		this.data = data;
	}

	public void addMeasure(Measure measure) {
		Object[] object = new Object[2];
		object[0] = measure.getAtLong();
		object[1] = measure.getVal();
		data.add(object);
		size += 1;
	}
}
